<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>注册</title>
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
<div class="width100">
    <div class="width1200 center_yh hidden_yh" style="height:181px">
        <a href="login.html" class="right_yh font16 c_33" style="line-height:181px;">已有帐号，<font class="red">马上去登录></font></a>
    </div>
</div>
<div class="width100 hidden_yh" style="border-top:1px solid #ddd">
    <div class="width1200 hidden_yh center_yh" style="margin-top:75px">
        <div class="width100 hidden_yh">
            <form>
                <div class="center_yh hidden_yh" style="width:475px;margin-bottom:40px;">
                    <span style="margin-right:40px;height:42px;line-height:42px;width:100px" class="left_yh block_yh tright">用户名:</span>
                    <input id="user" type="text" placeholder="请输入您的用户名" style="border:1px solid #c9c9c9;width:292px;height:42px;font-size:16px;text-indent:22px;" class="left_yh">
                </div>
                <div class="center_yh hidden_yh" style="width:475px;margin-bottom:40px;">
                    <span style="margin-right:40px;height:42px;line-height:42px;width:100px" class="left_yh block_yh tright">设置密码:</span>
                    <input id="pass1" type="password" placeholder="建议至少使用两种字符组合" style="border:1px solid #c9c9c9;width:292px;height:42px;font-size:16px;text-indent:22px;" class="left_yh">
                </div>
                <div class="center_yh hidden_yh" style="width:475px;margin-bottom:40px;">
                    <span style="margin-right:40px;height:42px;line-height:42px;width:100px" class="left_yh block_yh tright">确认密码:</span>
                    <input id="pass2" type="password" placeholder="请再次输入密码" style="border:1px solid #c9c9c9;width:292px;height:42px;font-size:16px;text-indent:22px;" class="left_yh">
                </div>
                <div class="center_yh hidden_yh" style="width:475px;margin-bottom:40px;">
                    <span style="margin-right:40px;height:42px;line-height:42px;width:100px" class="left_yh block_yh tright">手机号:</span>
                    <input id="tel" type="text" placeholder="建议使用常用的手机" style="border:1px solid #c9c9c9;width:292px;height:42px;font-size:16px;text-indent:22px;" class="left_yh">
                </div>
                <div class="center_yh hidden_yh" style="width:475px;margin-bottom:40px;">
                    <span style="margin-right:40px;height:42px;line-height:42px;width:100px" class="left_yh block_yh tright">验证码:</span>
                    <div style="width:293px;height:42px;border:1px solid #c9c9c9" class="left_yh">
                        <input type="text" placeholder="输入验证码" style="border:0;width:184px;height:39px;font-size:16px;text-indent:22px;" class="left_yh">
                        <img src="../images/s.jpg" style="width:103px;height:40px;margin-top:1px;float:right;margin-right:1px;">
                    </div>
                </div>
                <div class="center_yh hidden_yh" style="width:475px;">
                    <span style="margin-right:40px;height:42px;line-height:42px;width:100px" class="left_yh block_yh tright">手机验证码:</span>
                    <div style="width:293px;height:42px;border:1px solid #c9c9c9" class="left_yh">
                        <input type="text" placeholder="请输入验证码" style="border:0;width:184px;height:39px;font-size:16px;text-indent:22px;" class="left_yh">
                        <a href="javascript:void(0)" style="width:103px;height:40px;margin-top:1px;float:right;margin-right:1px;display:block;color:#666;background:#ddd;text-align:center;line-height:40px;">获取验证码</a>
                    </div>
                </div>
                <p class="font14 c_66" style="text-indent:503px;margin-top:30px;"><input type="checkbox">我已阅读并同意<a href="#" class="red">«会员注册协议»</a>和<a href="#" class="red">«隐私保护政策»</a></p>
                <button id="btn" type="button" class="ipt_tj" style="width:295px;height:44px;margin-left:505px;">
                    提交</button>
            </form>
        </div>
    </div>
</div>
<script src="../js/jquery-1.8.3.min.js"></script>
<script>
    $("#btn").click(function () {
        alert("进入ajax")
        $.ajax({
            url: "/reg",
            type: "post",
            dataType:"json",
            data: {
                username: $("#user").val(),
                password: $("#pass1").val(),
                tel: $("#tel").val()
            },
            success: function (result) {
                if (result.code == '1') {
                    window.location.href = "/login";
                }
                else  {
                    alert(result.msg);
                }
            }
        });
    });
</script>
</body>
</html>
